package com.sptpc.androidclass1012;

import androidx.appcompat.app.AppCompatActivity;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.ImageFormat;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends Activity {
    Button Btn_displayIntent;
    Button Btn_noneIntent;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Btn_displayIntent = findViewById(R.id.btn_1);
        Btn_noneIntent = findViewById(R.id.btn_2);
        Btn_displayIntent.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent1 = new Intent(MainActivity.this,DetailActivity.class);
                startActivity(intent1);

            }
        });
        Btn_noneIntent.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent2 = new Intent("android.intent.action.MYACTION");
                startActivity(intent2);
            }
        });
}
}
